//
//  SCGlobalConfig.m
//  智慧小区
//
//  Created by Dreamsoul on 15-6-27.
//  Copyright (c) 2015年 Dreamsoul. All rights reserved.
//

#import "SCGlobalConfig.h"
static NSString* myLoginId = nil;
@implementation SCGlobalConfig
//登录ID
+ (NSString*)myLoginId
{
    return myLoginId;
}
//设置登录ID
+ (void)setMyLoginId:(NSString*)loginId
{
    myLoginId = [loginId copy];
}
//判断是否已登录
+ (BOOL)IsLogin
{
    if(myLoginId.length&&![myLoginId isEqualToString:@"0"]){
        return YES;
    }else{
        return NO;
    }
}
//MBProgressHUD的自定义
+ (MBProgressHUD*)HUDShowMessage:(NSString*)msg addedToView:(UIView*)view
{
    if(view==nil){
        view=[[UIApplication sharedApplication].windows lastObject];
    }
    static MBProgressHUD* hud = nil;
    hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    hud.mode = MBProgressHUDModeText;
    hud.labelText = msg;
    hud.hidden = NO;
    hud.alpha = 1.0f;
    [hud hide:YES afterDelay:1.0f];
    return hud;
}
+ (MBProgressHUD*)HUDShowProgress:(NSString*)msg addedToView:(UIView*)view
{
    if(view==nil){
        view=[[UIApplication sharedApplication].windows lastObject];
    }
    static MBProgressHUD* hud = nil;
    hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    hud.mode = MBProgressHUDModeIndeterminate;
    hud.labelText = msg;
    hud.hidden = NO;
    hud.alpha = 1.0f;
    return hud;
}

@end
